#!/bin/bash

# This script moves the file which keeps track of the out-of-order stats to another directory, old_stats, every day
# order_oostats.sh takes care of ordering them into human-readable directories

# Set the crontab to move the file oo_stats into the old_stats directory everyday, with the new name
# being the name of the previous day (i.e. the day which the stats represent)

mv $HOME/printers/oo_status/oo_stats $HOME/printers/oo_status/old_stats/`date '+%Y_%m_%d' --date='1 day ago'`

# Create a new oo_stats file

touch $HOME/printers/oo_status/oo_stats

# Finally, call order_oostats.sh

$HOME/scripts/map_scripts/order_oostats.sh

exit 0
